
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>心灵影院</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">

    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>


    <style type="text/css">
        a:hover {
            text-decoration: none;  color:#FFAA33;
        }
        tab-item:active {
            color: #FFAA33;
        }
        .theme-dark .content{
            background-color: #333;
        }
        .list-block{
            margin: 0;
        }
        .list-block.theme-dark ul, .theme-dark .list-block ul{
            background-color: #333;
        }

        .bar-nav.theme-dark, .bar-tab.theme-dark, .theme-dark .bar-nav, .theme-dark .bar-tab{
            background-color: #333;
        }

        .bar .button-link{
            color: #ffffff;
        }

        .bar .button-nav.pull-left{
            float: left;

        }

        .search-input input{
            width: 75%;
            border-radius:1rem;
            background-color: #181b20;
            border: 0;
        }
        .bar input[type=search]{
            margin-left: 2rem;
        }


        .icon-left{
            color: #ffffff;
        }

        .list-block .item-content{
            padding-left: 0;
        }


        .font_yellow {
            color: #f9d13f;
        }
        .span-right{
            float: right;
        }
        .font_7{
            font-size: .7rem;
            padding: 0 1rem;
            color: #008C9E;
        }
        .font_7 a{
            color: #008C9E;
        }
        .font_7 .span-right{
            color: #f9d13f;
        }
        .button{
            height: 2.5rem;
            font-size: 1rem;

        }
        .button.button-fill{
            line-height: 2.5rem;
            color: #000000;
            background-color:#f9d13f ;
            /*letter-spacing:1rem;*/
        }

        .row.no-gutter .col-80{
            width: 68%;
        }
        .row.no-gutter .col-20{
            width: 30%;
        }
        .col-20  .button{
            height: 2rem;
            font-size: .85rem;
        }
        .col-20 .button.button-fill{
            line-height: 2rem;
        }

    </style>


</head>
<body class="theme-dark">
<div class="page">
    <header class="bar bar-nav">
        <!--<a class="button button-link button-nav pull-left back" href="/demos" >-->
        <!--<span class="icon icon-left"></span>-->
        <!--</a>-->
        <!--<div class="searchbar row">-->
        <!--<div class="search-input col-80">-->
        <!--<label class="icon icon-search" for="search"></label>-->
        <!--<input type="search" id='search' placeholder='输入关键字...'/>-->
        <!--</div>-->
        <!--<a class=" col-20">搜索</a>-->
        <!--</div>-->

        <header class="bar bar-nav">
            <a href="/login" class="icon icon-left pull-left"></a>
            <h1 class="title">找回密码</h1>
        </header>
    </header>

    <div class="content">
        <!-- 这里是页面内容区 -->
        <div class="list-block">
            <ul>
                <!-- Text inputs -->
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-name"></i></div>
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="text" id="input_phone" placeholder="输入手机号（只支持中国大陆）">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-email"></i></div>
                        <div class="item-inner">
                            <div class="item-input">
                                <input type="password" id="input_pwd" placeholder="输入密码（6-20位数字或英文）">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="row no-gutter">

                        <div class="col-80">
                            <div class="item-content">
                                <div class="item-media"><i class="icon icon-form-name"></i></div>
                                <div class="item-inner">
                                    <div class="item-input">
                                        <input id="input_code" type="text" placeholder="输入验证码">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-20">
                            <a href="javascript:GetCodeNumber();"
                               class="button button-fill button-success">发送验证码
                            </a>
                        </div>
                    </div>

                </li>
                <li>
                    <p><a href="javascript:UpdatePassword()"
                          class="button button-fill button-success">确
                        &nbsp;&nbsp;&nbsp;&nbsp;定 </a></p>
                </li>

            </ul>
        </div>

    </div>
</div>

<script type='text/javascript' src='/js/mortise/comm.js' charset='utf-8'></script>
<script type="text/javascript">

    function fullOpen(min,max) { // (n,m)
        return parseInt(Math.random()*(max-min+1)+min,10);
    }

    var Data_PhoneNs='';
    function GetCodeNumber() {
        var phone=$('#input_phone').val();
        var pwd=$('#input_pwd').val();
        if (!phone){
            alert('请输入手机号码！');
            return false;
        }
        if (!pwd){
            alert('请输入密码！');
            return false;
        }
        Data_PhoneNs=fullOpen(100000,999999);
        $.ajax({
            type: 'POST',
            url: '/api/sms/getRanNum?phoneNum='+phone+'&phoneSN='+Data_PhoneNs,
            dataType: 'json',
            success: function(data){
                if(mortise_layout.ValidataResult(data)){
                    if (data.code=='LoginSucess'){
                        window.location.href='/movieIndex';
                    }
                    else if (data.code=='LoginPassError'){
                        alert('帐号和密码有误，登录失败！');
                    }
                }
            }
        });
    }

    //用户注册接口
    function UpdatePassword() {
        var phone=$('#input_phone').val();
        var pwd=$('#input_pwd').val();
        var code=$('#input_code').val();
        if (!phone){
            alert('请输入手机号码！');
            return false;
        }
        if (!pwd){
            alert('请输入密码！');
            return false;
        }
        if (!code){
            alert('请输入验证码！');
            return false;
        }
        ///api/user/reguser?phone=13413950591&phoneSN=test1111&password=000000&code=0000&regapp=4
        $.ajax({
            type: 'POST',
            url: '/api/user/forgetpwd',
            data: { phone: phone,phoneSN:Data_PhoneNs,password:pwd,code:code ,regapp:6},
            dataType: 'json',
            success: function(data){
                if(mortise_layout.ValidataResult(data)){
                    if (data.code=='LoginSucess'){
                        window.location.href='/movieIndex';
                    }
                    else if (data.code=='LoginPassError'){
                        alert('帐号和密码有误，登录失败！');
                    }
                }
            }
        });
    }
</script>

</body>
</html>